<!DOCTYPE HTML>
<html lang="zh-cn" class="light" dir="ltr">
    <head>
            <script type="text/x-mathjax-config">
                MathJax.Hub.Config({
                    showProcessingMessages: false,
                    messageStyle: "none",
                    extensions: ['tex2jax.js'],
                    jax: ['input/TeX', 'output/HTML-CSS'],
                    tex2jax: {
                        inlineMath: [ ['$','$'], ["\\(","\\)"] ],
                        displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
                        processEscapes: true
                    },
                    "HTML-CSS": { availableFonts: ["STIX", "TeX"] }
                });
            </script>
            
        <!-- Book generated using mdBook -->
        <meta charset="UTF-8">
        <title>类 - 仓颉编程语言扩展库 API</title>


        <!-- Custom HTML head -->
        
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="theme-color" content="#ffffff">

        <link rel="icon" href="../../favicon.svg">
        <link rel="shortcut icon" href="../../favicon.png">
        <link rel="stylesheet" href="../../css/variables.css">
        <link rel="stylesheet" href="../../css/general.css">
        <link rel="stylesheet" href="../../css/chrome.css">
        <link rel="stylesheet" href="../../css/print.css" media="print">

        <!-- Fonts -->
        <link rel="stylesheet" href="../../FontAwesome/css/font-awesome.css">
        <link rel="stylesheet" href="../../fonts/fonts.css">

        <!-- Highlight.js Stylesheets -->
        <link rel="stylesheet" href="../../highlight.css">
        <link rel="stylesheet" href="../../tomorrow-night.css">
        <link rel="stylesheet" href="../../ayu-highlight.css">

        <!-- Custom theme stylesheets -->
        <link rel="stylesheet" href="../../assets/style.css">
        <link rel="stylesheet" href="../../assets/theme.css">

        <!-- MathJax -->
        <script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    </head>
    <body class="sidebar-visible no-js">
    <div id="body-container">
        <!-- Provide site root to javascript -->
        <script>
            var path_to_root = "../../";
            var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "light" : "light";
        </script>

        <!-- Work around some values being stored in localStorage wrapped in quotes -->
        <script>
            try {
                var theme = localStorage.getItem('mdbook-theme');
                var sidebar = localStorage.getItem('mdbook-sidebar');

                if (theme.startsWith('"') && theme.endsWith('"')) {
                    localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
                }

                if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
                    localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
                }
            } catch (e) { }
        </script>

        <!-- Set the theme before any content is loaded, prevents flash -->
        <script>
            var theme;
            try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
            if (theme === null || theme === undefined) { theme = default_theme; }
            var html = document.querySelector('html');
            html.classList.remove('light')
            html.classList.add(theme);
            var body = document.querySelector('body');
            body.classList.remove('no-js')
            body.classList.add('js');
        </script>

        <input type="checkbox" id="sidebar-toggle-anchor" class="hidden">

        <!-- Hide / unhide sidebar before it is displayed -->
        <script>
            var body = document.querySelector('body');
            var sidebar = null;
            var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
            if (document.body.clientWidth >= 1080) {
                try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
                sidebar = sidebar || 'visible';
            } else {
                sidebar = 'hidden';
            }
            sidebar_toggle.checked = sidebar === 'visible';
            body.classList.remove('sidebar-visible');
            body.classList.add("sidebar-" + sidebar);
        </script>

        <nav id="sidebar" class="sidebar" aria-label="Table of contents">
            <div class="sidebar-scrollbox">
                <ol class="chapter"><li class="chapter-item expanded "><a href="../../libs_overview.html"><strong aria-hidden="true">1.</strong> 仓颉编程语言扩展库 API</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../compress/zlib/zlib_package_overview.html"><strong aria-hidden="true">1.1.</strong> stdx.compress.zlib</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../compress/zlib/zlib_package_api/zlib_package_classes.html"><strong aria-hidden="true">1.1.1.</strong> 类</a></li><li class="chapter-item "><a href="../../compress/zlib/zlib_package_api/zlib_package_enums.html"><strong aria-hidden="true">1.1.2.</strong> 枚举</a></li><li class="chapter-item "><a href="../../compress/zlib/zlib_package_api/zlib_package_exceptions.html"><strong aria-hidden="true">1.1.3.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.1.4.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../compress/zlib/zlib_samples/deflate_compress_decompress.html"><strong aria-hidden="true">1.1.4.1.</strong> Deflate 格式数据的压缩和解压</a></li><li class="chapter-item "><a href="../../compress/zlib/zlib_samples/gzip_compress_decompress.html"><strong aria-hidden="true">1.1.4.2.</strong> Gzip 格式数据的压缩和解压</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../crypto/crypto/crypto_package_overview.html"><strong aria-hidden="true">1.2.</strong> stdx.crypto.crypto</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../crypto/crypto/crypto_package_api/crypto_package_classes.html"><strong aria-hidden="true">1.2.1.</strong> 类</a></li><li class="chapter-item "><a href="../../crypto/crypto/crypto_package_api/crypto_package_structs.html"><strong aria-hidden="true">1.2.2.</strong> 结构体</a></li><li class="chapter-item "><a href="../../crypto/crypto/crypto_package_api/crypto_package_exceptions.html"><strong aria-hidden="true">1.2.3.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.2.4.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../crypto/crypto/crypto_samples/sample_secure_random.html"><strong aria-hidden="true">1.2.4.1.</strong> SecureRandom 使用</a></li><li class="chapter-item "><a href="../../crypto/crypto/crypto_samples/sample_crypto.html"><strong aria-hidden="true">1.2.4.2.</strong> SM4 使用</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../crypto/digest/crypto_digest_package_overview.html"><strong aria-hidden="true">1.3.</strong> stdx.crypto.digest</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../crypto/digest/digest_package_api/digest_package_classes.html"><strong aria-hidden="true">1.3.1.</strong> 类</a></li><li class="chapter-item "><a href="../../crypto/digest/digest_package_api/digest_package_structs.html"><strong aria-hidden="true">1.3.2.</strong> 结构体</a></li><li class="chapter-item "><a href="../../crypto/digest/digest_package_api/digest_package_exceptions.html"><strong aria-hidden="true">1.3.3.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.3.4.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../crypto/digest/digest_samples/sample_digest.html"><strong aria-hidden="true">1.3.4.1.</strong> digest 使用</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../crypto/keys/keys_package_overview.html"><strong aria-hidden="true">1.4.</strong> stdx.crypto.keys</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../crypto/keys/keys_package_api/keys_package_classes.html"><strong aria-hidden="true">1.4.1.</strong> 类</a></li><li class="chapter-item "><a href="../../crypto/keys/keys_package_api/keys_package_enums.html"><strong aria-hidden="true">1.4.2.</strong> 枚举</a></li><li class="chapter-item "><a href="../../crypto/keys/keys_package_api/keys_package_structs.html"><strong aria-hidden="true">1.4.3.</strong> 结构体</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.4.4.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../crypto/keys/keys_samples/sample_keys.html"><strong aria-hidden="true">1.4.4.1.</strong> keys 使用</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../crypto/x509/x509_package_overview.html"><strong aria-hidden="true">1.5.</strong> stdx.crypto.x509</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../crypto/x509/x509_package_api/x509_package_type.html"><strong aria-hidden="true">1.5.1.</strong> 类型别名</a></li><li class="chapter-item "><a href="../../crypto/x509/x509_package_api/x509_package_interfaces.html"><strong aria-hidden="true">1.5.2.</strong> 接口</a></li><li class="chapter-item "><a href="../../crypto/x509/x509_package_api/x509_package_classes.html"><strong aria-hidden="true">1.5.3.</strong> 类</a></li><li class="chapter-item "><a href="../../crypto/x509/x509_package_api/x509_package_enums.html"><strong aria-hidden="true">1.5.4.</strong> 枚举</a></li><li class="chapter-item "><a href="../../crypto/x509/x509_package_api/x509_package_structs.html"><strong aria-hidden="true">1.5.5.</strong> 结构体</a></li><li class="chapter-item "><a href="../../crypto/x509/x509_package_api/x509_package_exceptions.html"><strong aria-hidden="true">1.5.6.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.5.7.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../crypto/x509/x509_samples/sample_x509.html"><strong aria-hidden="true">1.5.7.1.</strong> x509 使用</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../encoding/base64/base64_package_overview.html"><strong aria-hidden="true">1.6.</strong> stdx.encoding.base64</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/base64/base64_package_api/base64_package_funcs.html"><strong aria-hidden="true">1.6.1.</strong> 函数</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.6.2.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/base64/base64_samples/base64.html"><strong aria-hidden="true">1.6.2.1.</strong> Byte 数组和 Base64 互转</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../encoding/hex/hex_package_overview.html"><strong aria-hidden="true">1.7.</strong> stdx.encoding.hex</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/hex/hex_package_api/hex_package_funcs.html"><strong aria-hidden="true">1.7.1.</strong> 函数</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.7.2.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/hex/hex_samples/hex.html"><strong aria-hidden="true">1.7.2.1.</strong> Byte 数组和 Hex 互转</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../encoding/json/json_package_overview.html"><strong aria-hidden="true">1.8.</strong> stdx.encoding.json</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/json/json_package_api/encoding_json_package_interfaces.html"><strong aria-hidden="true">1.8.1.</strong> 接口</a></li><li class="chapter-item "><a href="../../encoding/json/json_package_api/encoding_json_package_classes.html"><strong aria-hidden="true">1.8.2.</strong> 类</a></li><li class="chapter-item "><a href="../../encoding/json/json_package_api/encoding_json_package_enums.html"><strong aria-hidden="true">1.8.3.</strong> 枚举</a></li><li class="chapter-item "><a href="../../encoding/json/json_package_api/encoding_json_package_exceptions.html"><strong aria-hidden="true">1.8.4.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.8.5.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/json/json_samples/json_array_sample.html"><strong aria-hidden="true">1.8.5.1.</strong> JsonArray 使用示例</a></li><li class="chapter-item "><a href="../../encoding/json/json_samples/json_value_sample.html"><strong aria-hidden="true">1.8.5.2.</strong> JsonValue 和 String 互相转换</a></li><li class="chapter-item "><a href="../../encoding/json/json_samples/to_json_sample.html"><strong aria-hidden="true">1.8.5.3.</strong> JsonValue 与 DataModel 的转换</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../encoding/json_stream/json_stream_package_overview.html"><strong aria-hidden="true">1.9.</strong> stdx.encoding.json.stream</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/json_stream/json_stream_package_api/encoding_json_stream_package_interfaces.html"><strong aria-hidden="true">1.9.1.</strong> 接口</a></li><li class="chapter-item "><a href="../../encoding/json_stream/json_stream_package_api/encoding_json_stream_package_classes.html"><strong aria-hidden="true">1.9.2.</strong> 类</a></li><li class="chapter-item "><a href="../../encoding/json_stream/json_stream_package_api/encoding_json_stream_package_enums.html"><strong aria-hidden="true">1.9.3.</strong> 枚举</a></li><li class="chapter-item "><a href="../../encoding/json_stream/json_stream_package_api/encoding_json_stream_package_structs.html"><strong aria-hidden="true">1.9.4.</strong> 结构体</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.9.5.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/json_stream/json_stream_samples/sample_json_reader.html"><strong aria-hidden="true">1.9.5.1.</strong> 使用 Json Stream 进行反序列化</a></li><li class="chapter-item "><a href="../../encoding/json_stream/json_stream_samples/sample_json_writer.html"><strong aria-hidden="true">1.9.5.2.</strong> 使用 Json Stream 进行序列化</a></li><li class="chapter-item "><a href="../../encoding/json_stream/json_stream_samples/sample_json_writeconfig.html"><strong aria-hidden="true">1.9.5.3.</strong> WriteConfig 使用示例</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../encoding/url/url_package_overview.html"><strong aria-hidden="true">1.10.</strong> stdx.encoding.url</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/url/url_package_api/url_package_classes.html"><strong aria-hidden="true">1.10.1.</strong> 类</a></li><li class="chapter-item "><a href="../../encoding/url/url_package_api/url_package_exceptions.html"><strong aria-hidden="true">1.10.2.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.10.3.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/url/url_samples/form.html"><strong aria-hidden="true">1.10.3.1.</strong> Form 的构造使用</a></li><li class="chapter-item "><a href="../../encoding/url/url_samples/url_parse.html"><strong aria-hidden="true">1.10.3.2.</strong> URL 解析函数 parse 的使用</a></li></ol></li></ol></li><li class="chapter-item expanded "><a href="../../fuzz/fuzz_package_overview.html"><strong aria-hidden="true">1.11.</strong> stdx.fuzz.fuzz</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../fuzz/fuzz_package_api/fuzz_package_constants_vars.html"><strong aria-hidden="true">1.11.1.</strong> 常量变量</a></li><li class="chapter-item expanded "><a href="../../fuzz/fuzz_package_api/fuzz_package_classes.html" class="active"><strong aria-hidden="true">1.11.2.</strong> 类</a></li><li class="chapter-item "><a href="../../fuzz/fuzz_package_api/fuzz_package_exceptions.html"><strong aria-hidden="true">1.11.3.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.11.4.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../fuzz/fuzz_samples/basic_fuzzing_test.html"><strong aria-hidden="true">1.11.4.1.</strong> 测试猜测字符功能</a></li><li class="chapter-item "><a href="../../fuzz/fuzz_samples/dataprovider_usage.html"><strong aria-hidden="true">1.11.4.2.</strong> 使用 DataProvider 功能进行测试</a></li><li class="chapter-item "><a href="../../fuzz/fuzz_samples/fake_coverage_usage.html"><strong aria-hidden="true">1.11.4.3.</strong> 使用 FakeCoverage 避免 DataProvider 模式下 Fuzz 异常终止</a></li><li class="chapter-item "><a href="../../fuzz/fuzz_samples/print_cj-fuzz_usage.html"><strong aria-hidden="true">1.11.4.4.</strong> 打印 fuzz 使用方法</a></li><li class="chapter-item "><a href="../../fuzz/fuzz_samples/print_coverage.html"><strong aria-hidden="true">1.11.4.5.</strong> 实验性特性-覆盖率信息打印</a></li><li class="chapter-item "><a href="../../fuzz/fuzz_samples/stack_backtrace_missing_solution.html"><strong aria-hidden="true">1.11.4.6.</strong> 栈回溯缺失的处理方案</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../log/log_package_overview.html"><strong aria-hidden="true">1.12.</strong> stdx.log</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../log/log_package_api/log_package_types.html"><strong aria-hidden="true">1.12.1.</strong> 类型别名</a></li><li class="chapter-item "><a href="../../log/log_package_api/log_package_funcs.html"><strong aria-hidden="true">1.12.2.</strong> 函数</a></li><li class="chapter-item "><a href="../../log/log_package_api/log_package_interfaces.html"><strong aria-hidden="true">1.12.3.</strong> 接口</a></li><li class="chapter-item "><a href="../../log/log_package_api/log_package_classes.html"><strong aria-hidden="true">1.12.4.</strong> 类</a></li><li class="chapter-item "><a href="../../log/log_package_api/log_package_structs.html"><strong aria-hidden="true">1.12.5.</strong> 结构体</a></li><li class="chapter-item "><a href="../../log/log_package_api/log_package_exceptions.html"><strong aria-hidden="true">1.12.6.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.12.7.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../log/log_samples/log_sample.html"><strong aria-hidden="true">1.12.7.1.</strong> 日志打印示例</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../logger/logger_package_overview.html"><strong aria-hidden="true">1.13.</strong> stdx.logger</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../logger/logger_package_api/logger_package_classes.html"><strong aria-hidden="true">1.13.1.</strong> 类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.13.2.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../logger/logger_samples/logger_sample.html"><strong aria-hidden="true">1.13.2.1.</strong> 日志打印示例</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../net/http/http_package_overview.html"><strong aria-hidden="true">1.14.</strong> stdx.net.http</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../net/http/http_package_api/http_package_funcs.html"><strong aria-hidden="true">1.14.1.</strong> 函数</a></li><li class="chapter-item "><a href="../../net/http/http_package_api/http_package_interfaces.html"><strong aria-hidden="true">1.14.2.</strong> 接口</a></li><li class="chapter-item "><a href="../../net/http/http_package_api/http_package_classes.html"><strong aria-hidden="true">1.14.3.</strong> 类</a></li><li class="chapter-item "><a href="../../net/http/http_package_api/http_package_enums.html"><strong aria-hidden="true">1.14.4.</strong> 枚举</a></li><li class="chapter-item "><a href="../../net/http/http_package_api/http_package_structs.html"><strong aria-hidden="true">1.14.5.</strong> 结构体</a></li><li class="chapter-item "><a href="../../net/http/http_package_api/http_package_exceptions.html"><strong aria-hidden="true">1.14.6.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.14.7.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../net/http/http_samples/http_client.html"><strong aria-hidden="true">1.14.7.1.</strong> client</a></li><li class="chapter-item "><a href="../../net/http/http_samples/cookie.html"><strong aria-hidden="true">1.14.7.2.</strong> cookie</a></li><li class="chapter-item "><a href="../../net/http/http_samples/log.html"><strong aria-hidden="true">1.14.7.3.</strong> log</a></li><li class="chapter-item "><a href="../../net/http/http_samples/http_server.html"><strong aria-hidden="true">1.14.7.4.</strong> server</a></li><li class="chapter-item "><a href="../../net/http/http_samples/webSocket.html"><strong aria-hidden="true">1.14.7.5.</strong> webSocket</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../net/tls/tls_package_overview.html"><strong aria-hidden="true">1.15.</strong> stdx.net.tls</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../net/tls/tls_package_api/tls_package_classes.html"><strong aria-hidden="true">1.15.1.</strong> 类</a></li><li class="chapter-item "><a href="../../net/tls/tls_package_api/tls_package_enums.html"><strong aria-hidden="true">1.15.2.</strong> 枚举</a></li><li class="chapter-item "><a href="../../net/tls/tls_package_api/tls_package_structs.html"><strong aria-hidden="true">1.15.3.</strong> 结构体</a></li><li class="chapter-item "><a href="../../net/tls/tls_package_api/tls_package_exceptions.html"><strong aria-hidden="true">1.15.4.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.15.5.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../net/tls/tls_samples/cert_key.html"><strong aria-hidden="true">1.15.5.1.</strong> 服务端证书及公钥在一份文件中</a></li><li class="chapter-item "><a href="../../net/tls/tls_samples/client.html"><strong aria-hidden="true">1.15.5.2.</strong> 客户端示例</a></li><li class="chapter-item "><a href="../../net/tls/tls_samples/hot_update_cert.html"><strong aria-hidden="true">1.15.5.3.</strong> 证书热更新</a></li><li class="chapter-item "><a href="../../net/tls/tls_samples/server.html"><strong aria-hidden="true">1.15.5.4.</strong> 服务端示例</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../serialization/serialization_package_overview.html"><strong aria-hidden="true">1.16.</strong> stdx.serialization.serialization</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../serialization/serialization_package_api/serialization_package_functions.html"><strong aria-hidden="true">1.16.1.</strong> 函数</a></li><li class="chapter-item "><a href="../../serialization/serialization_package_api/serialization_package_interfaces.html"><strong aria-hidden="true">1.16.2.</strong> 接口</a></li><li class="chapter-item "><a href="../../serialization/serialization_package_api/serialization_package_classes.html"><strong aria-hidden="true">1.16.3.</strong> 类</a></li><li class="chapter-item "><a href="../../serialization/serialization_package_api/serialization_package_exceptions.html"><strong aria-hidden="true">1.16.4.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.16.5.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../serialization/serialization_samples/serialize_and_deserialize_class.html"><strong aria-hidden="true">1.16.5.1.</strong> class 序列化和反序列化</a></li><li class="chapter-item "><a href="../../serialization/serialization_samples/serialize_hashmap_and_hashset.html"><strong aria-hidden="true">1.16.5.2.</strong> HashSet 和 HashMap 序列化</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../unittest/data/data_package_overview.html"><strong aria-hidden="true">1.17.</strong> stdx.unittest.data</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../unittest/data/data_package_api/data_package_functions.html"><strong aria-hidden="true">1.17.1.</strong> 函数</a></li><li class="chapter-item "><a href="../../unittest/data/data_package_api/data_package_classes.html"><strong aria-hidden="true">1.17.2.</strong> 类</a></li></ol></li></ol></li></ol>
            </div>
            <div id="sidebar-resize-handle" class="sidebar-resize-handle">
                <div class="sidebar-resize-indicator"></div>
            </div>
        </nav>

        <!-- Track and set sidebar scroll position -->
        <script>
            var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
            sidebarScrollbox.addEventListener('click', function(e) {
                if (e.target.tagName === 'A') {
                    sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
                }
            }, { passive: true });
            var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
            sessionStorage.removeItem('sidebar-scroll');
            if (sidebarScrollTop) {
                // preserve sidebar scroll position when navigating via links within sidebar
                sidebarScrollbox.scrollTop = sidebarScrollTop;
            } else {
                // scroll sidebar to current active section when navigating via "next/previous chapter" buttons
                var activeSection = document.querySelector('#sidebar .active');
                if (activeSection) {
                    activeSection.scrollIntoView({ block: 'center' });
                }
            }
        </script>

        <div id="page-wrapper" class="page-wrapper">

            <div class="page">
                                <div id="menu-bar-hover-placeholder"></div>
                <div id="menu-bar" class="menu-bar sticky">
                    <div class="left-buttons">
                        <label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
                            <i class="fa fa-bars"></i>
                        </label>
                        <button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
                            <i class="fa fa-paint-brush"></i>
                        </button>
                        <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
                            <li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
                        </ul>
                        <button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
                            <i class="fa fa-search"></i>
                        </button>
                    </div>

                    <h1 class="menu-title">仓颉编程语言扩展库 API</h1>

                    <div class="right-buttons">
                        <a href="../../print.html" title="Print this book" aria-label="Print this book">
                            <i id="print-button" class="fa fa-print"></i>
                        </a>

                    </div>
                </div>

                <div id="search-wrapper" class="hidden">
                    <form id="searchbar-outer" class="searchbar-outer">
                        <input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
                    </form>
                    <div id="searchresults-outer" class="searchresults-outer hidden">
                        <div id="searchresults-header" class="searchresults-header"></div>
                        <ul id="searchresults">
                        </ul>
                    </div>
                </div>

                <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
                <script>
                    document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
                    document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
                    Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
                        link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
                    });
                </script>

                <div id="content" class="content">
                    <main>
                        <h1 id="类"><a class="header" href="#类">类</a></h1>
<h2 id="class-debugdataprovider"><a class="header" href="#class-debugdataprovider">class DebugDataProvider</a></h2>
<pre><code class="language-cangjie">public class DebugDataProvider &lt;: FuzzDataProvider
</code></pre>
<p>功能：此类继承了 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 类型，额外增加了调试信息。</p>
<p>父类型：</p>
<ul>
<li><a href="#class-fuzzdataprovider">FuzzDataProvider</a></li>
</ul>
<h3 id="func-consumeall"><a class="header" href="#func-consumeall">func consumeAll()</a></h3>
<pre><code class="language-cangjie">public override func consumeAll(): Array&lt;UInt8&gt;
</code></pre>
<p>功能：将所有数据转换成 UInt8 类型数组。</p>
<p>返回值：</p>
<ul>
<li>Array&lt;UInt8&gt; - UInt8 类型数组。</li>
</ul>
<h3 id="func-consumeallasascii"><a class="header" href="#func-consumeallasascii">func consumeAllAsAscii()</a></h3>
<pre><code class="language-cangjie">public override func consumeAllAsAscii(): String
</code></pre>
<p>功能：将所有数据转换成 Ascii String 类型。</p>
<p>返回值：</p>
<ul>
<li>String - Ascii String 类型实例。</li>
</ul>
<h3 id="func-consumeallasstring"><a class="header" href="#func-consumeallasstring">func consumeAllAsString()</a></h3>
<pre><code class="language-cangjie">public override func consumeAllAsString(): String
</code></pre>
<p>功能：将所有数据转换成 utf8 String 类型。</p>
<p>返回值：</p>
<ul>
<li>String - utf8 String 类型实例。</li>
</ul>
<h3 id="func-consumeasciistringint64"><a class="header" href="#func-consumeasciistringint64">func consumeAsciiString(Int64)</a></h3>
<pre><code class="language-cangjie">public override func consumeAsciiString(maxLength: Int64): String
</code></pre>
<p>功能：将数据转换成 Ascii  String 类型实例。</p>
<p>参数：</p>
<ul>
<li>maxLength: Int64 - String 类型的最大长度。</li>
</ul>
<p>返回值：</p>
<ul>
<li>String - String 类型实例。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 maxLength 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumebool"><a class="header" href="#func-consumebool">func consumeBool()</a></h3>
<pre><code class="language-cangjie">public override func consumeBool(): Bool
</code></pre>
<p>功能：将数据转换成 Bool 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Bool - Bool 类型实例。</li>
</ul>
<h3 id="func-consumeboolsint64"><a class="header" href="#func-consumeboolsint64">func consumeBools(Int64)</a></h3>
<pre><code class="language-cangjie">public override func consumeBools(count: Int64): Array&lt;Bool&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 Bool 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;Bool&gt; - Bool 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumebyte"><a class="header" href="#func-consumebyte">func consumeByte()</a></h3>
<pre><code class="language-cangjie">public override func consumeByte(): Byte
</code></pre>
<p>功能：将数据转换成 Byte 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Byte - Byte 类型实例。</li>
</ul>
<h3 id="func-consumebytesint64"><a class="header" href="#func-consumebytesint64">func consumeBytes(Int64)</a></h3>
<pre><code class="language-cangjie">public override func consumeBytes(count: Int64): Array&lt;Byte&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 Byte 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;Byte&gt; - Byte 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumefloat32"><a class="header" href="#func-consumefloat32">func consumeFloat32()</a></h3>
<pre><code class="language-cangjie">public override func consumeFloat32(): Float32
</code></pre>
<p>功能：将数据转换成 Float32 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Float32 - Float32 类型实例。</li>
</ul>
<h3 id="func-consumefloat64"><a class="header" href="#func-consumefloat64">func consumeFloat64()</a></h3>
<pre><code class="language-cangjie">public override func consumeFloat64(): Float64
</code></pre>
<p>功能：将数据转换成 Float64 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Float64 - Float64 类型实例。</li>
</ul>
<h3 id="func-consumeint16"><a class="header" href="#func-consumeint16">func consumeInt16()</a></h3>
<pre><code class="language-cangjie">public override func consumeInt16(): Int16
</code></pre>
<p>功能：将数据转换成 Int16 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Int16 - Int16 类型实例。</li>
</ul>
<h3 id="func-consumeint16sint64"><a class="header" href="#func-consumeint16sint64">func consumeInt16s(Int64)</a></h3>
<pre><code class="language-cangjie">public override func consumeInt16s(count: Int64): Array&lt;Int16&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 Int16 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;Int16&gt; - Int16 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumeint32"><a class="header" href="#func-consumeint32">func consumeInt32()</a></h3>
<pre><code class="language-cangjie">public override func consumeInt32(): Int32
</code></pre>
<p>功能：将数据转换成 Int32 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Int32 - Int32 类型实例。</li>
</ul>
<h3 id="func-consumeint32sint64"><a class="header" href="#func-consumeint32sint64">func consumeInt32s(Int64)</a></h3>
<pre><code class="language-cangjie">public override func consumeInt32s(count: Int64): Array&lt;Int32&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 Int32 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;Int32&gt; - Int32 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumeint64"><a class="header" href="#func-consumeint64">func consumeInt64()</a></h3>
<pre><code class="language-cangjie">public override func consumeInt64(): Int64
</code></pre>
<p>功能：将数据转换成 Int64 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Int64 - Int64 类型实例。</li>
</ul>
<h3 id="func-consumeint64sint64"><a class="header" href="#func-consumeint64sint64">func consumeInt64s(Int64)</a></h3>
<pre><code class="language-cangjie">public override func consumeInt64s(count: Int64): Array&lt;Int64&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 Int64 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;Int64&gt; - Int64 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumeint8"><a class="header" href="#func-consumeint8">func consumeInt8()</a></h3>
<pre><code class="language-cangjie">public override func consumeInt8(): Int8
</code></pre>
<p>功能：将数据转换成 Int8 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Int8 - Int8 类型实例。</li>
</ul>
<h3 id="func-consumeint8sint64"><a class="header" href="#func-consumeint8sint64">func consumeInt8s(Int64)</a></h3>
<pre><code class="language-cangjie">public override func consumeInt8s(count: Int64): Array&lt;Int8&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 Int8 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;Int8&gt; - Int8 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumerune"><a class="header" href="#func-consumerune">func consumeRune()</a></h3>
<pre><code class="language-cangjie">public override func consumeRune(): Rune
</code></pre>
<p>功能：将数据转换成 Rune 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Rune - Rune 类型实例。</li>
</ul>
<h3 id="func-consumestringint64"><a class="header" href="#func-consumestringint64">func consumeString(Int64)</a></h3>
<pre><code class="language-cangjie">public override func consumeString(maxLength: Int64): String
</code></pre>
<p>功能：将数据转换成 utf8 String 类型实例。</p>
<p>参数：</p>
<ul>
<li>maxLength: Int64 - String 类型的最大长度。</li>
</ul>
<p>返回值：</p>
<ul>
<li>String - String 类型实例。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 maxLength 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumeuint16"><a class="header" href="#func-consumeuint16">func consumeUInt16()</a></h3>
<pre><code class="language-cangjie">public override func consumeUInt16(): UInt16
</code></pre>
<p>功能：将数据转换成 UInt16 类型实例。</p>
<p>返回值：</p>
<ul>
<li>UInt16 - UInt16 类型实例。</li>
</ul>
<h3 id="func-consumeuint16sint64"><a class="header" href="#func-consumeuint16sint64">func consumeUInt16s(Int64)</a></h3>
<pre><code class="language-cangjie">public override func consumeUInt16s(count: Int64): Array&lt;UInt16&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 UInt16 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;UInt16&gt; - UInt16 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumeuint32"><a class="header" href="#func-consumeuint32">func consumeUInt32()</a></h3>
<pre><code class="language-cangjie">public override func consumeUInt32(): UInt32
</code></pre>
<p>功能：将数据转换成 UInt32 类型实例。</p>
<p>返回值：</p>
<ul>
<li>UInt32 - UInt32 类型实例。</li>
</ul>
<h3 id="func-consumeuint32sint64"><a class="header" href="#func-consumeuint32sint64">func consumeUInt32s(Int64)</a></h3>
<pre><code class="language-cangjie">public override func consumeUInt32s(count: Int64): Array&lt;UInt32&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 UInt32 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;UInt32&gt; - UInt32 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumeuint64"><a class="header" href="#func-consumeuint64">func consumeUInt64()</a></h3>
<pre><code class="language-cangjie">public override func consumeUInt64(): UInt64
</code></pre>
<p>功能：将数据转换成 UInt64 类型实例。</p>
<p>返回值：</p>
<ul>
<li>UInt64 - UInt64 类型实例。</li>
</ul>
<h3 id="func-consumeuint64sint64"><a class="header" href="#func-consumeuint64sint64">func consumeUInt64s(Int64)</a></h3>
<pre><code class="language-cangjie">public override func consumeUInt64s(count: Int64): Array&lt;UInt64&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 UInt64 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;UInt64&gt; - UInt64 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumeuint8"><a class="header" href="#func-consumeuint8">func consumeUInt8()</a></h3>
<pre><code class="language-cangjie">public override func consumeUInt8(): UInt8
</code></pre>
<p>功能：将数据转换成 UInt8 类型实例。</p>
<p>返回值：</p>
<ul>
<li>UInt8 - UInt8 类型实例。</li>
</ul>
<h3 id="func-consumeuint8sint64"><a class="header" href="#func-consumeuint8sint64">func consumeUInt8s(Int64)</a></h3>
<pre><code class="language-cangjie">public override func consumeUInt8s(count: Int64): Array&lt;UInt8&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 UInt8 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;UInt8&gt; - UInt8 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-wrapfuzzdataprovider"><a class="header" href="#func-wrapfuzzdataprovider">func wrap(FuzzDataProvider)</a></h3>
<pre><code class="language-cangjie">public static func wrap(dp: FuzzDataProvider): DebugDataProvider
</code></pre>
<p>功能：根据 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 实例创建 <a href="fuzz_package_classes.html#class-debugdataprovider">DebugDataProvider</a> 实例。</p>
<p>参数：</p>
<ul>
<li>dp: <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> - <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 类型实例。</li>
</ul>
<p>返回值：</p>
<ul>
<li><a href="fuzz_package_classes.html#class-debugdataprovider">DebugDataProvider</a> - 类型实例。</li>
</ul>
<h2 id="class-fuzzer"><a class="header" href="#class-fuzzer">class Fuzzer</a></h2>
<pre><code class="language-cangjie">public class Fuzzer {
    public init(targetFunction: (Array&lt;UInt8&gt;) -&gt; Int32)
    public init(targetFunction: (Array&lt;UInt8&gt;) -&gt; Int32, args: Array&lt;String&gt;)
    public init(targetFunction: (FuzzDataProvider) -&gt; Int32)
    public init(targetFunction: (FuzzDataProvider) -&gt; Int32, args: Array&lt;String&gt;)
}
</code></pre>
<p>功能：<a href="fuzz_package_classes.html#class-fuzzer">Fuzzer</a> 类提供了 fuzz 工具的创建。用户提供需要进行 fuzz 测试的函数 <code>targetFunction</code>，以及设置特定的 fuzz 运行参数 <code>args</code> 比如 fuzz 执行次数、初始种子、生成数据最大长度等，可创建相应类型的 <a href="fuzz_package_classes.html#class-fuzzer">Fuzzer</a>。</p>
<h3 id="initarrayuint8---int32"><a class="header" href="#initarrayuint8---int32">init((Array&lt;UInt8&gt;) -&gt; Int32)</a></h3>
<pre><code class="language-cangjie">public init(targetFunction: (Array&lt;UInt8&gt;) -&gt; Int32)
</code></pre>
<p>功能：根据以 UInt8 数组为参数，以 Int32 为返回值的目标函数，创建 <a href="fuzz_package_classes.html#class-fuzzer">Fuzzer</a> 实例。</p>
<p>参数：</p>
<ul>
<li>targetFunction: (Array&lt;UInt8&gt;) -&gt;Int32 - 以 UInt8 数组为参数，以 Int32 为返回值的目标函数。</li>
</ul>
<h3 id="initarrayuint8---int32-arraystring"><a class="header" href="#initarrayuint8---int32-arraystring">init((Array&lt;UInt8&gt;) -&gt; Int32, Array&lt;String&gt;)</a></h3>
<pre><code class="language-cangjie">public init(targetFunction: (Array&lt;UInt8&gt;) -&gt; Int32, args: Array&lt;String&gt;)
</code></pre>
<p>功能：根据以 UInt8 数组为参数，以 Int32 为返回值的目标函数，以及 Fuzz 运行参数，创建 <a href="fuzz_package_classes.html#class-fuzzer">Fuzzer</a> 实例。</p>
<p>参数：</p>
<ul>
<li>targetFunction: (Array&lt;UInt8&gt;) -&gt;Int32 - 以 UInt8 数组为参数，以 Int32 为返回值的目标函数。</li>
<li>args: Array&lt;String&gt; - Fuzz 运行参数。</li>
</ul>
<h3 id="initfuzzdataprovider---int32"><a class="header" href="#initfuzzdataprovider---int32">init((FuzzDataProvider) -&gt; Int32)</a></h3>
<pre><code class="language-cangjie">public init(targetFunction: (FuzzDataProvider) -&gt; Int32)
</code></pre>
<p>功能：根据以 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 为参数，以 Int32 为返回值的目标函数，创建 <a href="fuzz_package_classes.html#class-fuzzer">Fuzzer</a> 实例。</p>
<p>参数：</p>
<ul>
<li>targetFunction: (<a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a>) -&gt;Int32 - 以 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 为参数，以 Int32 为返回值的目标函数。</li>
</ul>
<h3 id="initfuzzdataprovider---int32-arraystring"><a class="header" href="#initfuzzdataprovider---int32-arraystring">init((FuzzDataProvider) -&gt; Int32, Array&lt;String&gt;)</a></h3>
<pre><code class="language-cangjie">public init(targetFunction: (FuzzDataProvider) -&gt; Int32, args: Array&lt;String&gt;)
</code></pre>
<p>功能：根据以 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 为参数，以 Int32 为返回值的目标函数，以及 Fuzz 运行参数，创建 <a href="fuzz_package_classes.html#class-fuzzer">Fuzzer</a> 实例。</p>
<p>参数：</p>
<ul>
<li>targetFunction: (<a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a>) -&gt;Int32 - 以 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 为参数，以 Int32 为返回值的目标函数。</li>
<li>args: Array&lt;String&gt; - Fuzz 运行参数。</li>
</ul>
<h3 id="func-disabledebugdataprovider"><a class="header" href="#func-disabledebugdataprovider">func disableDebugDataProvider()</a></h3>
<pre><code class="language-cangjie">public func disableDebugDataProvider(): Unit
</code></pre>
<p>功能：关闭调试信息打印功能，当 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a>.consumeXXX 被调用时，返回值将不被打印到 <code>stdout</code>。</p>
<h3 id="func-disablefakecoverage"><a class="header" href="#func-disablefakecoverage">func disableFakeCoverage()</a></h3>
<pre><code class="language-cangjie">public func disableFakeCoverage(): Unit
</code></pre>
<p>功能：关闭调用 <code>enableFakeCoverage</code> 对 Fuzz 的影响。</p>
<h3 id="func-enabledebugdataprovider"><a class="header" href="#func-enabledebugdataprovider">func enableDebugDataProvider()</a></h3>
<pre><code class="language-cangjie">public func enableDebugDataProvider(): Unit
</code></pre>
<p>功能：启用调试信息打印功能，当 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a>.consumeXXX 被调用时，返回值将被打印到 <code>stdout</code>。该功能默认为关闭。</p>
<h3 id="func-enablefakecoverage"><a class="header" href="#func-enablefakecoverage">func enableFakeCoverage()</a></h3>
<pre><code class="language-cangjie">public func enableFakeCoverage(): Unit
</code></pre>
<p>功能：创建一块虚假的覆盖率反馈区域，保持 Fuzz 持续进行。在 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 模式下，前几轮运行时可能由于数据不足而导致没有覆盖率，libfuzzer 会退出。该功能默认为关闭。</p>
<h3 id="func-getargs"><a class="header" href="#func-getargs">func getArgs()</a></h3>
<pre><code class="language-cangjie">public func getArgs(): Array&lt;String&gt;
</code></pre>
<p>功能：获取 Fuzz 运行参数。</p>
<p>返回值：</p>
<ul>
<li>Array&lt;String&gt; - 当前 Fuzz 运行参数。</li>
</ul>
<h3 id="func-setargsarraystring"><a class="header" href="#func-setargsarraystring">func setArgs(Array&lt;String&gt;)</a></h3>
<pre><code class="language-cangjie">public func setArgs(args: Array&lt;String&gt;): Unit
</code></pre>
<p>功能：设置 Fuzz 运行参数。</p>
<p>参数：</p>
<ul>
<li>args: Array&lt;String&gt; - Fuzz 运行参数。</li>
</ul>
<h3 id="func-settargetfunctionarrayuint8---int32"><a class="header" href="#func-settargetfunctionarrayuint8---int32">func setTargetFunction((Array&lt;UInt8&gt;) -&gt; Int32)</a></h3>
<pre><code class="language-cangjie">public func setTargetFunction(targetFunction: (Array&lt;UInt8&gt;) -&gt; Int32): Unit
</code></pre>
<p>功能：设置 Fuzz 目标函数。</p>
<p>参数：</p>
<ul>
<li>targetFunction: (Array&lt;UInt8&gt;) -&gt;Int32 - 以 UInt8 数组为参数，以 Int32 为返回值的目标函数。</li>
</ul>
<h3 id="func-settargetfunctionfuzzdataprovider---int32"><a class="header" href="#func-settargetfunctionfuzzdataprovider---int32">func setTargetFunction((FuzzDataProvider) -&gt; Int32)</a></h3>
<pre><code class="language-cangjie">public func setTargetFunction(targetFunction: (FuzzDataProvider) -&gt; Int32): Unit
</code></pre>
<p>功能：设置 Fuzz 目标函数。</p>
<p>参数：</p>
<ul>
<li>targetFunction: (<a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a>) -&gt;Int32 - 以 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 为参数，以 Int32 为返回值的目标函数。</li>
</ul>
<h3 id="func-startfuzz"><a class="header" href="#func-startfuzz">func startFuzz()</a></h3>
<pre><code class="language-cangjie">public func startFuzz(): Unit
</code></pre>
<p>功能：执行 Fuzz。</p>
<h2 id="class-fuzzerbuilder"><a class="header" href="#class-fuzzerbuilder">class FuzzerBuilder</a></h2>
<pre><code class="language-cangjie">public class FuzzerBuilder {
    public init(targetFunction: (Array&lt;UInt8&gt;) -&gt; Int32)
    public init(targetFunction: (FuzzDataProvider) -&gt; Int32)
}
</code></pre>
<p>功能：此类用于 <a href="fuzz_package_classes.html#class-fuzzer">Fuzzer</a> 类的构建。</p>
<h3 id="initarrayuint8---int32-1"><a class="header" href="#initarrayuint8---int32-1">init((Array&lt;UInt8&gt;) -&gt; Int32)</a></h3>
<pre><code class="language-cangjie">public init(targetFunction: (Array&lt;UInt8&gt;) -&gt; Int32)
</code></pre>
<p>功能：根据以 UInt8 数组为参数，以 Int32 为返回值的目标函数，创建 <a href="fuzz_package_classes.html#class-fuzzerbuilder">FuzzerBuilder</a> 实例。</p>
<p>参数：</p>
<ul>
<li>targetFunction: (Array&lt;UInt8&gt;) -&gt;Int32 - 以 UInt8 数组为参数，以 Int32 为返回值的目标函数。</li>
</ul>
<h3 id="initfuzzdataprovider---int32-1"><a class="header" href="#initfuzzdataprovider---int32-1">init((FuzzDataProvider) -&gt; Int32)</a></h3>
<pre><code class="language-cangjie">public init(targetFunction: (FuzzDataProvider) -&gt; Int32)
</code></pre>
<p>功能：根据以 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 为参数，以 Int32 为返回值的目标函数，创建 <a href="fuzz_package_classes.html#class-fuzzerbuilder">FuzzerBuilder</a> 实例。</p>
<p>参数：</p>
<ul>
<li>targetFunction: (<a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a>) -&gt;Int32 - 以 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 为参数，以 Int32 为返回值的目标函数。</li>
</ul>
<h3 id="func-build"><a class="header" href="#func-build">func build()</a></h3>
<pre><code class="language-cangjie">public func build(): Fuzzer
</code></pre>
<p>功能：生成一个 <a href="fuzz_package_classes.html#class-fuzzer">Fuzzer</a> 实例。</p>
<p>返回值：</p>
<ul>
<li><a href="fuzz_package_classes.html#class-fuzzer">Fuzzer</a> - <a href="fuzz_package_classes.html#class-fuzzer">Fuzzer</a> 实例。</li>
</ul>
<h3 id="func-setargsarraystring-1"><a class="header" href="#func-setargsarraystring-1">func setArgs(Array&lt;String&gt;)</a></h3>
<pre><code class="language-cangjie">public func setArgs(args: Array&lt;String&gt;): FuzzerBuilder
</code></pre>
<p>功能：设置 Fuzz 运行参数。</p>
<p>参数：</p>
<ul>
<li>args: Array&lt;String&gt; - Fuzz 运行参数。</li>
</ul>
<p>返回值：</p>
<ul>
<li><a href="fuzz_package_classes.html#class-fuzzerbuilder">FuzzerBuilder</a> - 当前 <a href="fuzz_package_classes.html#class-fuzzerbuilder">FuzzerBuilder</a> 实例。</li>
</ul>
<h3 id="func-settargetfunctionarrayuint8---int32-1"><a class="header" href="#func-settargetfunctionarrayuint8---int32-1">func setTargetFunction((Array&lt;UInt8&gt;) -&gt; Int32)</a></h3>
<pre><code class="language-cangjie">public func setTargetFunction(targetFunction: (Array&lt;UInt8&gt;) -&gt; Int32): FuzzerBuilder
</code></pre>
<p>功能：设置 Fuzz 目标函数。</p>
<p>参数：</p>
<ul>
<li>targetFunction: (Array&lt;UInt8&gt;) -&gt;Int32 - 以 UInt8 数组为参数，以 Int32 为返回值的目标函数。</li>
</ul>
<p>返回值：</p>
<ul>
<li><a href="fuzz_package_classes.html#class-fuzzerbuilder">FuzzerBuilder</a> - 当前 <a href="fuzz_package_classes.html#class-fuzzerbuilder">FuzzerBuilder</a> 实例。</li>
</ul>
<h3 id="func-settargetfunctionfuzzdataprovider---int32-1"><a class="header" href="#func-settargetfunctionfuzzdataprovider---int32-1">func setTargetFunction((FuzzDataProvider) -&gt; Int32)</a></h3>
<pre><code class="language-cangjie">public func setTargetFunction(targetFunction: (FuzzDataProvider) -&gt; Int32): FuzzerBuilder
</code></pre>
<p>功能：设置 Fuzz 目标函数。</p>
<p>参数：</p>
<ul>
<li>targetFunction: (<a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a>) -&gt;Int32 - 以 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 为参数，以 Int32 为返回值的目标函数。</li>
</ul>
<p>返回值：</p>
<ul>
<li><a href="fuzz_package_classes.html#class-fuzzerbuilder">FuzzerBuilder</a> - 当前 <a href="fuzz_package_classes.html#class-fuzzerbuilder">FuzzerBuilder</a> 实例。</li>
</ul>
<h2 id="class-fuzzdataprovider"><a class="header" href="#class-fuzzdataprovider">class FuzzDataProvider</a></h2>
<pre><code class="language-cangjie">public open class FuzzDataProvider {
    public let data: Array&lt;UInt8&gt;
    public var remainingBytes: Int64
    public var offset: Int64
}
</code></pre>
<p>功能：<a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 是一个工具类，目的是将变异数据的字节流转化为标准的仓颉基本数据。</p>
<p>当前支持的数据结构如下：</p>
<div class="table-wrapper"><table><thead><tr><th>目标类型</th><th>API</th><th>说明</th></tr></thead><tbody>
<tr><td>Bool</td><td>consumeBool()</td><td>获取 1 个 Bool，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Array&lt;Bool&gt;</td><td>consumeBools(count: Int64)</td><td>获取 N 个 Bool，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Byte</td><td>consumeByte()</td><td>获取 1 个 Byte，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Array&lt;Byte&gt;</td><td>consumeBytes(count: Int64)</td><td>获取 N 个 Byte，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>UInt8</td><td>consumeUInt8()</td><td>获取 1 个 UInt8，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>UInt16</td><td>consumeUInt16()</td><td>获取 1 个 UInt16，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>UInt32</td><td>consumeUInt32()</td><td>获取 1 个 UInt32，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>UInt64</td><td>consumeUInt64()</td><td>获取 1 个 UInt64，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Int8</td><td>consumeInt8()</td><td>获取 1 个 Int8，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Int16</td><td>consumeInt16()</td><td>获取 1 个 Int16，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Int32</td><td>consumeInt32()</td><td>获取 1 个 Int32，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Int64</td><td>consumeInt64()</td><td>获取 1 个 Int64，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Float32</td><td>consumeFloat32()</td><td>获取 1 个 Float32，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Float64</td><td>consumeFloat64()</td><td>获取 1 个 Float64，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Array&lt;UInt8&gt;</td><td>consumeUInt8s(count: Int64)</td><td>获取 N 个 UInt8，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Array&lt;UInt16&gt;</td><td>consumeUInt16s(count: Int64)</td><td>获取 N 个 UInt16，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Array&lt;UInt32&gt;</td><td>consumeUInt32s(count: Int64)</td><td>获取 N 个 UInt32，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Array&lt;UInt64&gt;</td><td>consumeUInt64s(count: Int64)</td><td>获取 N 个 UInt64，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Array&lt;Int8&gt;</td><td>consumeInt8s(count: Int64)</td><td>获取 N 个 Int8，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Array&lt;Int16&gt;</td><td>consumeInt16s(count: Int64)</td><td>获取 N 个 Int16，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Array&lt;Int32&gt;</td><td>consumeInt32s(count: Int64)</td><td>获取 N 个 Int32，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Array&lt;Int64&gt;</td><td>consumeInt64s(count: Int64)</td><td>获取 N 个 Int64，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>Rune</td><td>consumeRune()</td><td>获取 1 个 Rune，变异数据长度不足时，抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>。</td></tr>
<tr><td>String</td><td>consumeAsciiString(maxLength: Int64)</td><td>获取 1 个纯 ASCII 的 String，长度为 0 到 maxLength，可以为 0。</td></tr>
<tr><td>String</td><td>consumeString(maxLength: Int64)</td><td>获取 1 个 UTF8 String，长度为 0 到 maxLength，可以为 0。</td></tr>
<tr><td>Array&lt;UInt8&gt;</td><td>consumeAll()</td><td>将 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 中的剩余内容全部转化为字节数组。</td></tr>
<tr><td>String</td><td>consumeAllAsAscii()</td><td>将 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 中的剩余内容全部转化为纯 ASCII 的 String。</td></tr>
<tr><td>String</td><td>consumeAllAsString()</td><td>将 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 中的剩余内容全部转化为 UTF8 String，末尾多余的字符不会被消耗。</td></tr>
</tbody></table>
</div>
<p>在数据长度不足时，调用上述大部分虽然会抛出 <a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a>，但编写 fuzz 函数时通常并不需要对它进行处理，<a href="fuzz_package_exceptions.html#class-exhaustedexception">ExhaustedException</a> 默认会被 fuzz 框架捕获，告诉 libfuzzer 该次运行无效，请继续下一轮变异。随着执行时间的变长，变异数据也会逐渐变长，直到满足 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 的需求。</p>
<p>如果达到了 <code>max_len</code> 仍无法满足 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 的需求，则进程退出，请修改 fuzz 测试用例（推荐） 或 增大 <code>max_len</code>（不推荐）。</p>
<h3 id="let-data"><a class="header" href="#let-data">let data</a></h3>
<pre><code class="language-cangjie">public let data: Array&lt;UInt8&gt;
</code></pre>
<p>功能：变异数据。</p>
<p>类型：Array&lt;UInt8&gt;</p>
<h3 id="var-offset"><a class="header" href="#var-offset">var offset</a></h3>
<pre><code class="language-cangjie">public var offset: Int64
</code></pre>
<p>功能：已转化的字节数。</p>
<p>类型：Int64</p>
<h3 id="var-remainingbytes"><a class="header" href="#var-remainingbytes">var remainingBytes</a></h3>
<pre><code class="language-cangjie">public var remainingBytes: Int64
</code></pre>
<p>功能：剩余字节数。</p>
<p>类型：Int64</p>
<h3 id="func-consumeall-1"><a class="header" href="#func-consumeall-1">func consumeAll()</a></h3>
<pre><code class="language-cangjie">public open func consumeAll(): Array&lt;UInt8&gt;
</code></pre>
<p>功能：将所有数据转换成 UInt8 类型数组。</p>
<p>返回值：</p>
<ul>
<li>Array&lt;UInt8&gt; - UInt8 类型数组。</li>
</ul>
<h3 id="func-consumeallasascii-1"><a class="header" href="#func-consumeallasascii-1">func consumeAllAsAscii()</a></h3>
<pre><code class="language-cangjie">public open func consumeAllAsAscii(): String
</code></pre>
<p>功能：将所有数据转换成 Ascii String 类型。</p>
<p>返回值：</p>
<ul>
<li>String - Ascii String 类型实例。</li>
</ul>
<h3 id="func-consumeallasstring-1"><a class="header" href="#func-consumeallasstring-1">func consumeAllAsString()</a></h3>
<pre><code class="language-cangjie">public open func consumeAllAsString(): String
</code></pre>
<p>功能：将所有数据转换成 utf8 String 类型。</p>
<p>返回值：</p>
<ul>
<li>String - utf8 String 类型实例。</li>
</ul>
<h3 id="func-consumeasciistringint64-1"><a class="header" href="#func-consumeasciistringint64-1">func consumeAsciiString(Int64)</a></h3>
<pre><code class="language-cangjie">public open func consumeAsciiString(maxLength: Int64): String
</code></pre>
<p>功能：将数据转换成 Ascii  String 类型实例。</p>
<p>参数：</p>
<ul>
<li>maxLength: Int64 - String 类型的最大长度。</li>
</ul>
<p>返回值：</p>
<ul>
<li>String - String 类型实例。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 maxLength 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumebool-1"><a class="header" href="#func-consumebool-1">func consumeBool()</a></h3>
<pre><code class="language-cangjie">public open func consumeBool(): Bool
</code></pre>
<p>功能：将数据转换成 Bool 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Bool - Bool 类型实例。</li>
</ul>
<h3 id="func-consumeboolsint64-1"><a class="header" href="#func-consumeboolsint64-1">func consumeBools(Int64)</a></h3>
<pre><code class="language-cangjie">public open func consumeBools(count: Int64): Array&lt;Bool&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 Bool 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;Bool&gt; - Bool 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumebyte-1"><a class="header" href="#func-consumebyte-1">func consumeByte()</a></h3>
<pre><code class="language-cangjie">public open func consumeByte(): Byte
</code></pre>
<p>功能：将数据转换成 Byte 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Byte - Byte 类型实例。</li>
</ul>
<h3 id="func-consumebytesint64-1"><a class="header" href="#func-consumebytesint64-1">func consumeBytes(Int64)</a></h3>
<pre><code class="language-cangjie">public open func consumeBytes(count: Int64): Array&lt;Byte&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 Byte 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;Byte&gt; - Byte 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumefloat32-1"><a class="header" href="#func-consumefloat32-1">func consumeFloat32()</a></h3>
<pre><code class="language-cangjie">public open func consumeFloat32(): Float32
</code></pre>
<p>功能：将数据转换成 Float32 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Float32 - Float32 类型实例。</li>
</ul>
<h3 id="func-consumefloat64-1"><a class="header" href="#func-consumefloat64-1">func consumeFloat64()</a></h3>
<pre><code class="language-cangjie">public open func consumeFloat64(): Float64
</code></pre>
<p>功能：将数据转换成 Float64 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Float64 - Float64 类型实例。</li>
</ul>
<h3 id="func-consumeint16-1"><a class="header" href="#func-consumeint16-1">func consumeInt16()</a></h3>
<pre><code class="language-cangjie">public open func consumeInt16(): Int16
</code></pre>
<p>功能：将数据转换成 Int16 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Int16 - Int16 类型实例。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumeint16sint64-1"><a class="header" href="#func-consumeint16sint64-1">func consumeInt16s(Int64)</a></h3>
<pre><code class="language-cangjie">public open func consumeInt16s(count: Int64): Array&lt;Int16&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 Int16 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;Int16&gt; - Int16 类型数组。</li>
</ul>
<h3 id="func-consumeint32-1"><a class="header" href="#func-consumeint32-1">func consumeInt32()</a></h3>
<pre><code class="language-cangjie">public open func consumeInt32(): Int32
</code></pre>
<p>功能：将数据转换成 Int32 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Int32 - Int32 类型实例。</li>
</ul>
<h3 id="func-consumeint32sint64-1"><a class="header" href="#func-consumeint32sint64-1">func consumeInt32s(Int64)</a></h3>
<pre><code class="language-cangjie">public open func consumeInt32s(count: Int64): Array&lt;Int32&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 Int32 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;Int32&gt; - Int32 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumeint64-1"><a class="header" href="#func-consumeint64-1">func consumeInt64()</a></h3>
<pre><code class="language-cangjie">public open func consumeInt64(): Int64
</code></pre>
<p>功能：将数据转换成 Int64 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Int64 - Int64 类型实例。</li>
</ul>
<h3 id="func-consumeint64sint64-1"><a class="header" href="#func-consumeint64sint64-1">func consumeInt64s(Int64)</a></h3>
<pre><code class="language-cangjie">public open func consumeInt64s(count: Int64): Array&lt;Int64&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 Int64 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;Int64&gt; - Int64 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumeint8-1"><a class="header" href="#func-consumeint8-1">func consumeInt8()</a></h3>
<pre><code class="language-cangjie">public open func consumeInt8(): Int8
</code></pre>
<p>功能：将数据转换成 Int8 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Int8 - Int8 类型实例。</li>
</ul>
<h3 id="func-consumeint8sint64-1"><a class="header" href="#func-consumeint8sint64-1">func consumeInt8s(Int64)</a></h3>
<pre><code class="language-cangjie">public open func consumeInt8s(count: Int64): Array&lt;Int8&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 Int8 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;Int8&gt; - Int8 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumerune-1"><a class="header" href="#func-consumerune-1">func consumeRune()</a></h3>
<pre><code class="language-cangjie">public open func consumeRune(): Rune
</code></pre>
<p>功能：将数据转换成 Rune 类型实例。</p>
<p>返回值：</p>
<ul>
<li>Rune - Rune 类型实例。</li>
</ul>
<h3 id="func-consumestringint64-1"><a class="header" href="#func-consumestringint64-1">func consumeString(Int64)</a></h3>
<pre><code class="language-cangjie">public open func consumeString(maxLength: Int64): String
</code></pre>
<p>功能：将数据转换成 utf8 String 类型实例。</p>
<p>参数：</p>
<ul>
<li>maxLength: Int64 - String 类型的最大长度。</li>
</ul>
<p>返回值：</p>
<ul>
<li>String - String 类型实例。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 maxLength 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumeuint16-1"><a class="header" href="#func-consumeuint16-1">func consumeUInt16()</a></h3>
<pre><code class="language-cangjie">public open func consumeUInt16(): UInt16
</code></pre>
<p>功能：将数据转换成 UInt16 类型实例。</p>
<p>返回值：</p>
<ul>
<li>UInt16 - UInt16 类型实例。</li>
</ul>
<h3 id="func-consumeuint16sint64-1"><a class="header" href="#func-consumeuint16sint64-1">func consumeUInt16s(Int64)</a></h3>
<pre><code class="language-cangjie">public open func consumeUInt16s(count: Int64): Array&lt;UInt16&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 UInt16 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;UInt16&gt; - UInt16 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumeuint32-1"><a class="header" href="#func-consumeuint32-1">func consumeUInt32()</a></h3>
<pre><code class="language-cangjie">public open func consumeUInt32(): UInt32
</code></pre>
<p>功能：将数据转换成 UInt32 类型实例。</p>
<p>返回值：</p>
<ul>
<li>UInt32 - UInt32 类型实例。</li>
</ul>
<h3 id="func-consumeuint32sint64-1"><a class="header" href="#func-consumeuint32sint64-1">func consumeUInt32s(Int64)</a></h3>
<pre><code class="language-cangjie">public open func consumeUInt32s(count: Int64): Array&lt;UInt32&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 UInt32 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;UInt32&gt; - UInt32 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumeuint64-1"><a class="header" href="#func-consumeuint64-1">func consumeUInt64()</a></h3>
<pre><code class="language-cangjie">public open func consumeUInt64(): UInt64
</code></pre>
<p>功能：将数据转换成 UInt64 类型实例。</p>
<p>返回值：</p>
<ul>
<li>UInt64 - UInt64 类型实例。</li>
</ul>
<h3 id="func-consumeuint64sint64-1"><a class="header" href="#func-consumeuint64sint64-1">func consumeUInt64s(Int64)</a></h3>
<pre><code class="language-cangjie">public open func consumeUInt64s(count: Int64): Array&lt;UInt64&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 UInt64 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;UInt64&gt; - UInt64 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="func-consumeuint8-1"><a class="header" href="#func-consumeuint8-1">func consumeUInt8()</a></h3>
<pre><code class="language-cangjie">public open func consumeUInt8(): UInt8
</code></pre>
<p>功能：将数据转换成 UInt8 类型实例。</p>
<p>返回值：</p>
<ul>
<li>UInt8 - UInt8 类型实例。</li>
</ul>
<h3 id="func-consumeuint8sint64-1"><a class="header" href="#func-consumeuint8sint64-1">func consumeUInt8s(Int64)</a></h3>
<pre><code class="language-cangjie">public open func consumeUInt8s(count: Int64): Array&lt;UInt8&gt;
</code></pre>
<p>功能：将指定数量的数据转换成 UInt8 类型数组。</p>
<p>参数：</p>
<ul>
<li>count: Int64 - 指定转换的数据量。</li>
</ul>
<p>返回值：</p>
<ul>
<li>Array&lt;UInt8&gt; - UInt8 类型数组。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 如果 count 为负数，则抛出异常。</li>
</ul>
<h3 id="static-func-withcangjiedataarrayuint8"><a class="header" href="#static-func-withcangjiedataarrayuint8">static func withCangjieData(Array&lt;UInt8&gt;)</a></h3>
<pre><code class="language-cangjie">public static func withCangjieData(data: Array&lt;UInt8&gt;): FuzzDataProvider
</code></pre>
<p>功能：使用 Array&lt;UInt8&gt; 类型的数据生成 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 类型实例。</p>
<p>参数：</p>
<ul>
<li>data: Array&lt;UInt8&gt; - 输入的外部数据。</li>
</ul>
<p>返回值：</p>
<ul>
<li><a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> - 构造的 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 类型实例。</li>
</ul>
<h3 id="static-func-withnativedatacpointeruint8-int64"><a class="header" href="#static-func-withnativedatacpointeruint8-int64">static func withNativeData(CPointer&lt;UInt8&gt;, Int64)</a></h3>
<pre><code class="language-cangjie">public static unsafe func withNativeData(data: CPointer&lt;UInt8&gt;, length: Int64): FuzzDataProvider
</code></pre>
<p>功能：使用 C 指针数据生成 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 类型实例。</p>
<p>参数：</p>
<ul>
<li>data: CPointer&lt;UInt8&gt; - 输入的外部数据。</li>
<li>length: Int64 - 数据长度。</li>
</ul>
<p>返回值：</p>
<ul>
<li><a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> - 构造的 <a href="fuzz_package_classes.html#class-fuzzdataprovider">FuzzDataProvider</a> 类型实例。</li>
</ul>

                    </main>

                    <nav class="nav-wrapper" aria-label="Page navigation">
                        <!-- Mobile navigation buttons -->
                            <a rel="prev" href="../../fuzz/fuzz_package_api/fuzz_package_constants_vars.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
                                <i class="fa fa-angle-left"></i>
                            </a>

                            <a rel="next prefetch" href="../../fuzz/fuzz_package_api/fuzz_package_exceptions.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                                <i class="fa fa-angle-right"></i>
                            </a>

                        <div style="clear: both"></div>
                    </nav>
                </div>
            </div>

            <nav class="nav-wide-wrapper" aria-label="Page navigation">
                    <a rel="prev" href="../../fuzz/fuzz_package_api/fuzz_package_constants_vars.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
                        <i class="fa fa-angle-left"></i>
                    </a>

                    <a rel="next prefetch" href="../../fuzz/fuzz_package_api/fuzz_package_exceptions.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                        <i class="fa fa-angle-right"></i>
                    </a>
            </nav>

        </div>




        <script>
            window.playground_copyable = true;
        </script>


        <script src="../../elasticlunr.min.js"></script>
        <script src="../../mark.min.js"></script>
        <script src="../../searcher.js"></script>

        <script src="../../clipboard.min.js"></script>
        <script src="../../cangjie-highlight-export.js"></script><script src="../../highlight.js"></script>
        <script src="../../book.js"></script>

        <!-- Custom JS scripts -->
        
        <script src="../../cangjie-highlight-export.js"></script><script src="../../highlight.js"></script>
        <script src="../../assets/elasticlunr.js"></script>
        <script src="../../assets/fzf.umd.js"></script>
        <script src="../../assets/sidebar.js"></script>


    </div>
    </body>
</html>
